import request from '@/utils/request'
// , setToken, removeToken
import { getToken } from '@/utils/auth'

// 合作商
export function listPartnerCompany(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listPartnerCompany',
    method: 'get',
    params: query
  })
}

// 合作商
export function listPartnerOptions(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/list',
    method: 'get',
    params: query
  })
}

// 分公司
export function listBranchCompany() {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listBranchCompany',
    method: 'get'
  })
}

// 查询省份
export function province() {
  return request({
    url: '/wxh-cloud-rest/rest/provCityAreaQuery/province',
    method: 'get'
  })
}
// 查询省份
export function province2() {
  return request({
    url: '/support/provCityAreaQuery/province',
    method: 'get'
  })
}

// 查询城市
export function city(id) {
  return request({
    url: '/wxh-cloud-rest/rest/provCityAreaQuery/city/' + id,
    method: 'get'
  })
}

// 查询县区
export function area(id) {
  return request({
    url: '/wxh-cloud-rest/rest/provCityAreaQuery/area/' + id,
    method: 'get'
  })
}

// 查询街道
export function street(id) {
  return request({
    url: '/wxh-cloud-rest/rest/provCityAreaQuery/street/' + id,
    method: 'get'
  })
}

// 上传图片
export function upload(data) {
  return request({
    url: '/wxh-cloud-rest/rest/images/upload',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
